package com.nkzy.mapper;

import com.nkzy.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
/*
* Mapper是MyBatis的接口层,我们在接口层通过注解的方法可以
* 完成对数据库表进行增删改查
* 可以通过@Mapper注解实现IoC
* */
@Mapper
public interface UserMapper {
    @Select("select * from user where username=#{username}")
    User selectUserByName(String username);
    @Insert("insert into user(username,password,create_time,update_time) values(#{username},#{password},now(),now())")
    void insert(String username, String password);
}
